//
//  KAButton.m
//  KeepAccounts
//
//  Created by honeyrr on 2017/10/8.
//  Copyright © 2017年 honeyrr. All rights reserved.
//

#import "KAButton.h"

@implementation KAButton

-(void)layoutSubviews
{
    [super layoutSubviews];
    //将button内部原有的子视图重新布局
    CGFloat BtnWidth = self.bounds.size.width;
    CGFloat BtnHeight = self.bounds.size.height;
    //1.imageView
    self.imageView.bounds = CGRectMake(0, 0, 50, 50);
    self.imageView.center = CGPointMake(BtnWidth/2, BtnHeight/2);
    
    //2.titleLabel
    self.titleLabel.bounds = CGRectMake(0, 0, BtnWidth, 20);
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.center = CGPointMake(BtnWidth/2, CGRectGetMaxY(self.imageView.frame) + 6);
}

@end
